This was caching the metadata tree in-process, but it was
returning this cache even for calls for things other then this
item.
As a result, if you did $file->getHandler()->getPageText( $file, 2 )
twice in a single request, the second time it would return false.
Change-Id: I6ee4dce3177c0898e98210d7471cfadc1108ca52
* @return bool
*/
function getMetaTree( $image, $gettext = false ) {
* @return bool
*/
function getMetaTree( $image, $gettext = false ) {
- if ( isset( $image->dejaMetaTree ) ) {
+ if ( $gettext && isset( $image->djvuTextTree ) ) {
+ return $image->djvuTextTree;
+ }
+ if ( !$gettext && isset( $image->dejaMetaTree ) ) {
return $image->dejaMetaTree;
}
return $image->dejaMetaTree;
}